<?php

namespace App\Admin\Metrics\Examples;

use Dcat\Admin\Widgets\Metrics\Line;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class NewPart extends Line
 {
        protected function init()
        {
            parent::init();
            
            //用户总数量
            $userdata =  DB::table('parts')->count();
      
        
            $this->withContent( $userdata);
        }
    
        /**
         * 卡片内容
         *
         * @param string $content
         *
         * @return $this
         */
        public function withContent($content)
        {
            return $this->content(
                <<<HTML
    <div class="d-flex flex-column flex-wrap text-center">
        <h1>配件数量</h1>
        <h1 class="font-large-2 mt-2 mb-0">{$content}</h1>
        
        
    </div>
    HTML
            );
        }
    }


    

   